#pragma once
#include "NodeServer.h"
#include "ObjPtrList.h"
#include "ObjList.h"
#include "LobbyPlayer.h"
#include "LWProtocol.h"

enum
{
	User_Group_Count = 8192,
};

struct WorldUserInfo
{
public:
	WorldUserInfo()
	{
        m_dwUserId = 0;
	}
public:
	DWORD m_dwUserId;
    CObjList<UserSignupInfo> m_listSignupInfo;
public:
	BOOL	AddSignupInfo(DWORD dwProductId, DWORD tmMatchStartTime);
	BOOL	DelSignupInfo(DWORD dwProductId, DWORD tmMatchStartTime);
	BOOL    GetSignupCount() {return m_listSignupInfo.GetCount();};
};

class CWorldServer : public CNodeServer
{
public:
	CWorldServer(void);
	~CWorldServer(void);

	virtual BOOL OnInitialUpdate();
	virtual CServerPlayer *CreateServerPlayer(int nOrigin, int nServerId);

	WorldUserInfo *GetWorldUserInfo(DWORD dwUserId);
	void OnUserOnline(DWORD dwUserId, CLobbyPlayer *pPlayer);

	CObjPtrList<WorldUserInfo>	m_arrlistUserInfo[User_Group_Count];
	CLock m_arrLock[User_Group_Count];
};

extern CWorldServer *g_pWorldServer;